#pragma once

#include <vector>

#include "collector.h"


template <typename T>
class VectorCollectorAdapter : public Collector<T>
{
public:
    VectorCollectorAdapter(std::vector<T> &vec)
        : vec_(vec) {}

    virtual ~VectorCollectorAdapter() {}

    virtual void add(const T &e) override {
        vec_.push_back(e);
    }

    virtual void add(T &&e) override {
        vec_.push_back(std::move(e));
    }

private:
    std::vector<T> &vec_;
};
